<div class="page-title">

    <div class="title-env">
        <h1 class="title">点卡生成</h1>
    </div>

    <div class="breadcrumb-env">

        <ol class="breadcrumb bc-1">
            <li>
                <a href="{:url('/')}"><i class="fa-home"></i>Home</a>
            </li>

            <li class="active">

                <strong>System</strong>
            </li>
        </ol>

    </div>

</div>
<form id="form1" method="post">
    <input type="hidden" name="content" id="content" value="">
</form>
<div class="panel panel-default">

    <div class="panel-body">
            <div class="form-group">
                <label class="control-labell" for="field-5"></label>
                <select name="ctime" id="ss" class="form-control">

                    <!-- <option value="0.75"}>七天:0.75元</option> -->
                    <!-- <option value="1.5"}>一个月:1.5元</option> -->
                    <option value="0.25"}>三个月</option>
                   <option value="0.5"}>六个月</option>
                    <option value="1" selected="selected" }>一年</option>
                    <!-- <option value="150"}>永久:150元</option> -->
                </select>
            </div>
            <div class="form-group">
                <label class="control-labell" for="field-5">份数</label>
                <input type="number" id="fen" class="form-control" value="" name="fen" >
            </div>

            <div class="form-group">
                <button type="submit" onclick="tian()" class="btn btn-success">提交</button>
                <button type="reset" class="btn btn-white">重置</button>
            </div>
<script>
function tian() {
    var ctime   =   $('#ss').val();
    var fen     =   $('#fen').val();
    $.ajax({
        'type'  :   'post',
        'url'   :   '/index/dianka/sheng.html',
        'data'  :   {
            'ctime' :   ctime,
            'fen'   :   fen
        },
        'dataType'  :   'json',
        'success'   :   function (msg) {
            if(msg.code=='1')
            {
                layer.alert(msg.dian,{
                    btn:['txt导出','excel导出','取消'],
                    btn1: function(index, layero){
                        // window.open('/index/dao/txt.html?content='+msg.dian);
                        $('#form1').attr('action', '/index/dao/txt.html');
                        $('#content').val(msg.dian);
                        $('#form1').submit();
                    }
                    ,btn2: function(index, layero){
                        // window.open('/index/dao/excel.html?content='+msg.dian);
                        $('#form1').attr('action', '/index/dao/excel.html');
                        $('#content').val(msg.dian);
                        $('#form1').submit();
                        return false
                    }
                })
            }else{
                layer.alert(msg.dian);
            }
        },
        'error' :   function () {
            layer.alert('服务器错误');
        }
    })
}

</script>
        <?php

foreach($dian as $v)
{
echo $v."<br>";
        }
?>
    </div>

</div>